<?php

namespace App\Model;

use Illuminate\Database\Eloquent\Model;

class Product extends Model
{
    //
    protected $table = "product";
    public $timestamps = false;

    /**
     * 根据id获取产品信息
     * @param $id
     * @return mixed
     */
    public static function getProductInfo($id)
    {
        $res = self::where('id',$id)->first();
        return $res;
    }

    /**
     * @param $id
     * @return mixed
     */
    public static function getCategoryInfo($id) {
        $res = self::where('category',$id)->get()->toArray();
        return $res;
    }
}